import { api } from './client';

export interface Folder {
  id: string;
  name: string;
  parent_id?: string;
}

export interface CreateFolderRequest {
  name: string;
  parent_id?: string;
}

// 获取文件夹列表
export const getFolders = async (): Promise<Folder[]> => {
  const response = await api.get<Folder[]>('/folders');
  return response;
};

// 创建文件夹
export const createFolder = async (request: CreateFolderRequest): Promise<Folder> => {
  const response = await api.post<Folder>('/folders', request);
  return response;
};

export const folderApi = {
  getFolders,
  createFolder,
};

export default folderApi;
